import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建房间
export function createAccommodationRoom(data) {
  return request({
    url: adminUrl + '/collegebase/accommodation-room/create',
    method: 'post',
    data: data
  })
}

// 更新房间
export function updateAccommodationRoom(data) {
  return request({
    url: adminUrl + '/collegebase/accommodation-room/update',
    method: 'put',
    data: data
  })
}

// 删除房间
export function deleteAccommodationRoom(id) {
  return request({
    url: adminUrl + '/collegebase/accommodation-room/delete?id=' + id,
    method: 'delete'
  })
}

// 获得房间
export function getAccommodationRoom(id) {
  return request({
    url: adminUrl + '/collegebase/accommodation-room/get?id=' + id,
    method: 'get'
  })
}

// 获得房间分页
export function getAccommodationRoomPage(query) {
  return request({
    url: adminUrl + '/collegebase/accommodation-room/page',
    method: 'get',
    params: query
  })
}

// 导出房间 Excel
export function exportAccommodationRoomExcel(query) {
  return request({
    url: adminUrl + '/collegebase/accommodation-room/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
//根据房间号获取 床铺
export function byRoomList(roomId) {
  return request({
    url: adminUrl + '/collegebase/accommodation-bed/byRoom/list',
    method: 'get',
    params: {
      roomId
    }
  })
}
